<?php
	session_start();
	error_reporting(E_ALL);
	
	if(version_compare(phpversion(),'5.1.0','<')==true){
		die('PHP5.1 Only');
	}
	
	// Константы:
	
	define('VERSION',"1.3.0");
	define('DIRSEP',DIRECTORY_SEPARATOR);
	
	
	// Узнаём путь до файлов сайта
	$site_path=realpath(dirname(__FILE__).DIRSEP.'..'.DIRSEP).DIRSEP."conference".DIRSEP;
	
	define('site_path',$site_path);
	
	include(site_path."engine".DIRSEP."startup.php");
	
	# Соединяемся с БД
	
	$db = new PDO('mysql:host=localhost;dbname=mgucomua_conference;charset=UTF-8','mgucomua_conf','Cudp3exA');
	$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
	$db->query('set names utf8');
	DB::set($db);
	if (get_magic_quotes_gpc()) {
	    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
	    while (list($key, $val) = each($process)) {
	        foreach ($val as $k => $v) {
	            unset($process[$key][$k]);
	            if (is_array($v)) {
	                $process[$key][stripslashes($k)] = $v;
	                $process[] = &$process[$key][stripslashes($k)];
	            } else {
	                $process[$key][stripslashes($k)] = stripslashes($v);
	            }
	        }
	    }
	    unset($process);
	}
	if(!isset($routerOff)){
		//Загружаем router
		$router = new Router();
		
		$router->setPath(site_path.'controllers');
		
		$router->delegate();
	}
?>